package com.dream21th.common.exception;

import com.dream21th.common.enums.RtnEnum;
import lombok.Data;

@Data
public class WebException extends RuntimeException {

	private static final long serialVersionUID = 1L;

    private String msg;
    private String code = "500";

    public WebException(String msg) {
		super(msg);
		this.msg = msg;
	}

	public WebException(String msg, Throwable e) {
		super(msg, e);
		this.msg = msg;
	}

	public WebException(String code, String msg) {
		super(msg);
		this.msg = msg;
		this.code = code;
	}

	public WebException(String code, String msg, Throwable e) {
		super(msg, e);
		this.msg = msg;
		this.code = code;
	}

	public WebException(RtnEnum rtnEnum){
    	super(rtnEnum.getMessage());
		this.msg = rtnEnum.getMessage();
		this.code = rtnEnum.getCode();
	}
}
